<%@page import="java.util.Date"%>
<%@page import="com.pb.poem.entity.Poem"%>
<%@page import="com.pb.poem.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../common/common.jsp" %>
<%
String uid = (String)session.getAttribute("uid");
//String openkey = (String)session.getAttribute("sessionkey");
User user = api.getUser();
String title=request.getParameter("title");
String content=request.getParameter("content");
//String author="测试用户";
String author = user.getNickname();
content=content.replaceAll("<[\\w\\s\\/]*>|\\s", "");//去掉<br />,空格等
System.out.println("title:"+title+",content:"+content);/////////////////////////
Poem poem=new Poem();
poem.setPoemname(title);
poem.setAuthor(author);
poem.setContent(content);
poem.setDate(new Date());
poem.setUid(uid);

out.print(poemService.addpoem(poem));
%>